home *** CD-ROM | disk | FTP | other *** search
- #ifndef LIBRARIES_PCIEXPANSION_H
- #define LIBRARIES_PCIEXPANSION_H
-
- /*
- ** $VER: pciexpansion.h 1.0 (22.12.9)
- **
- ** pciexpansion.library include file
- **
- ** (C) Copyright 1997-1998 MicroniK
- ** All Rights Reserved
- **
- */
- #ifndef EXEC_TYPES_H
- #include "exec/types.h"
- #endif
-
- #include <libraries/configvars.h>
-
- #define PCIEXPANSIONNAME "pciexpansion.library"
-
- /* pci card configuration header format */
- /* Can be accessed by ReadCfgReg (RW) */
- /* or via pciexpansion.library (RO) */
- struct PCICfg {
- struct pci_id {
- ULONG did : 16; /* Device ID. */
- ULONG vid : 16; /* Vendor ID. 0xFFFF - slot empty */
- } pcie_id;
- struct pci_cs {
- ULONG d_pe : 1; /* Detected Parity Error. */
- ULONG s_serr : 1; /* Signaled SERR#. */
- ULONG r_ma : 1; /* Received Master-Abort. */
- ULONG r_ta : 1; /* Received Target-Abort. */
- ULONG s_ta : 1; /* Signaled Target-Abort. */
- ULONG devsel : 2; /* DEVSEL timing. */
- ULONG dp_d : 1; /* Data Parity Detected. */
- ULONG tfbbc : 1; /* Target Fast Back to Back Capable. */
- ULONG udfs : 1; /* User Definable Features Support. */
- ULONG dev66 : 1; /* Device 66 MHz Capable. */
- ULONG res1 : 5; /* PCI Reserved. */
- ULONG res2 : 6; /* PCI Reserved. */
- ULONG mfbbc : 1; /* Master Fast Back-to-Back Enable. */
- ULONG serr_en : 1; /* SERR# Enable. */
- ULONG step : 1; /* Data/address stepping. */
- ULONG peresp : 1; /* Parity Error Response. */
- ULONG vgaps : 1; /* VGA Palette Snoop. */
- ULONG mwi_en : 1; /* Memory Write and Invalidate Enable. */
- ULONG sca : 1; /* Special Cycles action. */
- ULONG bm : 1; /* Bus Master. */
- ULONG ms : 1; /* Memory Space. */
- ULONG ios : 1; /* I/O Space. */
- } pcie_cs;
- struct pci_class {
- ULONG base : 8; /* Base Class Code. */
- ULONG sub : 8; /* Sub Class Code. */
- ULONG prog : 8; /* Programming Interface. */
- ULONG revid : 8; /* Revision ID. */
- } pcie_class;
- struct pci_misc0 {
- ULONG bistc : 1; /* BIST Capable. */
- ULONG sbist : 1; /* Start BIST. */
- ULONG res1 : 2; /* PCI Reserved. */
- ULONG ccode : 4; /* Completion Code. */
- ULONG mfunct : 1; /* Multifunction Device. */
- ULONG layout : 7; /* Configuration Space Layout. */
- ULONG ltimer : 5; /* Latency Timer. */
- ULONG zero1 : 7; /* Zeros. */
- ULONG cline : 2; /* CacheLine Size. */
- ULONG zero2 : 2; /* Zeros. */
- } pcie_misc0;
- union pci_base_address {
- struct pci_mem_addr {
- ULONG ba : 28; /* Base Address. */
- ULONG pref : 1; /* Prefetchable */
- ULONG type : 2; /* 00 - locate anywhere in 32bit space */
- /* 01 - locate below 1MB */
- /* 10 - locate anywhare in 64bit space */
- /* 11 - reserved */
- ULONG space : 1; /* PCI Bus Address Space. */
- /* 0 - memory space */
- } pcie_mem_addr;
- struct pci_io_addr {
- ULONG ba : 30; /* Base Address. */
- ULONG zero1 : 1; /* Zeros. */
- ULONG space : 1; /* PCI Bus Address Space. */
- /* 1 - IO space */
- } pcie_io_addr;
- ULONG valUlong; /* if you prefer to mask bits */
- } pcie_baddr[6]; /* up to 6 adres registers */
- ULONG pcie_CISptr; /* Cardbus CIS pointer */
- struct pci_sid {
- ULONG sid : 16; /* Subsystem ID. */
- ULONG svid : 16; /* Subsystem Vendor ID. */
- } pcie_sid;
- union pci_rom_addr {
- struct {
- ULONG ba : 21; /* Base Address. */
- ULONG zero1 : 10; /* Zeros. */
- ULONG ena : 1; /* ROM enable */
- } bits;
- ULONG valUlong;
- } pcie_rom_addr;
- ULONG pci_Reserved1;
- ULONG pci_Reserved2;
- struct pci_misc1 {
- ULONG max_lat : 8; /* Maximum Latency. */
- ULONG min_gnt : 8; /* Minimum Grant. */
- ULONG int_pin : 8; /* Interrupt Pin. */
- ULONG int_line : 8; /* Interrupt Line. */
- } pcie_misc1;
- };
-
-
- struct PCIConfDev {
- struct Node DevNode;
- struct PCICfg Config;
- struct ConfigDev * ExpansionDev;
- struct PCIExpDev * next;
- UBYTE SlotNo;
- UBYTE Size[7]; /* 6 base addresses and rom size */
- };
-
- /*
- ** TAGS to FindPCIDev
- ** used to select PCI cards
- */
- #define PCIE_TAGBASE 0xABCD0000
- #define PCIE_CONFIGDEV (PCIE_TAGBASE+1)
- #define PCIE_VENDORID (PCIE_TAGBASE+2)
- #define PCIE_DEVICEID (PCIE_TAGBASE+3)
- #define PCIE_BASECLASSCODE (PCIE_TAGBASE+4)
-
-
- #endif /* LIBRARIES_PCIEXPANSION_H */
-
-
-